package com.zyh.scs.common.security.custom;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;


@Slf4j
@ComponentScan("com.zyh.scs.common.security.custom")
@Configuration
public class CustomSecurityConfig {

    @Bean
    public WebSecurityCustomizer webSecurityCustomizer() {
        final String[] matchers = {"/**.html","/**.png","/**.svg","/img/**","/icon/**","/js/**"};
        final WebSecurityCustomizer webSecurityCustomizer = (web) -> web.ignoring().requestMatchers(matchers);
        log.info("CustomSecurityConfig_webSecurityCustomizer => {}", webSecurityCustomizer);
        return webSecurityCustomizer;
    }
}
